<script setup>
import {artGetChannelsService} from '@/api/article.js'
import {ref} from 'vue'

defineProps({
	modelValue:{
		type:[Number,String]
	}
})
const emit = defineEmits(['update:cid'])
const channelList = ref([])
const getChannelList = async()=>{
	const res = await artGetChannelsService()
	channelList.value = res.data.data
	console.log(res);
}
getChannelList()
</script>
<template>
		<!-- label 展示给用户看的，value 收集起来 -->
    <el-select :modelValue="modelValue" @update:modelValue="emit('update:modelValue',$event)" style="width: 200px;">
      <el-option v-for="channel in channelList" :key="channel.id"  :label="channel.cate_name" :value="channel.id"></el-option>
    </el-select>
</template>